package ac.framework.ui.shadowed.white;

import java.awt.Color;

import javax.swing.Icon;
import javax.swing.JLabel;
import javax.swing.border.Border;

import ac.svn.accesscontrol.ui.DropShadowBorder;

public class WhiteLabel extends JLabel {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private Border shadowBorder = new DropShadowBorder(Color.BLACK,5,0.5f,5,true,true,true,true);
    
    public WhiteLabel() {
	initProperties();
    }

    public WhiteLabel(String arg0) {
	super(arg0);
	initProperties();
    }

    public WhiteLabel(Icon arg0) {
	super(arg0);
	initProperties();
    }

    public WhiteLabel(String arg0, int arg1) {
	super(arg0, arg1);
	initProperties();
    }

    public WhiteLabel(Icon arg0, int arg1) {
	super(arg0, arg1);
	initProperties();
    }

    public WhiteLabel(String arg0, Icon arg1, int arg2) {
	super(arg0, arg1, arg2);
	initProperties();
    }

    private void initProperties()
    {
	setOpaque(true);
	setBackground(Color.WHITE);
    }

    public void enableShadow(boolean b)
    {
	if(b)
	{
	    setBorder(shadowBorder);
	}
	else
	{
	    setBorder((new JLabel()).getBorder());   
	}
    }

    /**
     * @return the shadowBorder
     */
    public Border getShadowBorder() {
        return shadowBorder;
    }

    /**
     * @param shadowBorder the shadowBorder to set
     */
    public void setShadowBorder(Border shadowBorder) {
        this.shadowBorder = shadowBorder;
    }

}
